<?php

use think\migration\Migrator;
use think\migration\db\Column;

class Jobs extends Migrator
{
    public function up()
    {
        $users = $this->table('jobs', array('comment' => '队列信息'));
        $users->addColumn('queue', 'string')
              ->addColumn(Column::longText('payload'))        
              ->addColumn('attempts', 'integer', array('limit' => 3))
              ->addColumn('reserved', 'integer', array('limit' => 3))
              ->addColumn('reserved_at', 'integer', array('limit' => 10))
              ->addColumn('available_at', 'integer', array('limit' => 10))
              ->addColumn('created_at', 'integer', array('limit' => 10))
              ->save();     
    }

    /**
     * Migrate Down.
     */
    public function down()
    {
        $this->dropTable('jobs');
    }
}
